package com.duoduo;

/**
 * @author dl.chai
 * @version 1.0
 * @description: 单列
 * @date 2023/5/30 18:09
 */

public class Singleton {
    private volatile static  Singleton singleton;
    public Singleton(){};
    public  Singleton getSingleton(){
        if (singleton==null){
            synchronized (Singleton.class){
                if (singleton==null){
                    singleton=new Singleton();
                }
            }
        }
        return  singleton;
    }
}
